public class Test {


    public static void main(String[] args) {
        BinarryTree tree = new BinarryTree();
        tree.creatTree();
        tree.preOrder(tree.root);
        System.out.println();
        tree.getLeafNodeCount(tree.root);
        System.out.println("叶子节点："+tree.useSize2);
        System.out.println("叶子节点："+tree.getLeafNodeCount2(tree.root));
        System.out.println("第k层的叶子节点个数："+tree.getKLeafNodeCount(tree.root, 3));
        System.out.println("二叉树的高度："+tree.getHeight(tree.root));
        BinarryTree.TreeNode valnode = tree.find(tree.root, 'H');
        if(valnode != null) {
            System.out.println("存在"+valnode.val);
        }else {
            System.out.println("不存在val");
        }

    }
    public static void main1(String[] args) {
        BinarryTree tree = new BinarryTree();
        tree.creatTree();
        tree.preOrder(tree.root);
        System.out.println();
        tree.inOrder(tree.root);
        System.out.println();
        tree.postOrder(tree.root);
        System.out.println();
        tree.size1(tree.root);
        System.out.println(tree.useSize);
        System.out.println(tree.size2(tree.root));
    }
}
